# HTTP模块CMakeLists.txt
# 简化的HTTP模块构建配置

cmake_minimum_required(VERSION 3.10)

# 使用GLOB收集源文件，避免路径问题
file(GLOB HTTP_SOURCES "*.cpp")

# 创建库
add_library(http_module STATIC ${HTTP_SOURCES})

# 设置C++标准
set_target_properties(http_module PROPERTIES
        CXX_STANDARD 17
        CXX_STANDARD_REQUIRED ON
)

# 包含目录
target_include_directories(http_module PUBLIC
        ${CMAKE_SOURCE_DIR}/include
)

# 链接依赖库 - 移除依赖关系检查，简化构建
target_link_libraries(http_module PUBLIC
    pthread
)

# 如果网络库存在，则链接
if(TARGET network_lib)
    target_link_libraries(http_module PUBLIC network_lib)
endif()

# 如果日志库存在，则链接
if(TARGET common_logger_lib)
    target_link_libraries(http_module PUBLIC common_logger_lib)
endif()

message(STATUS "HTTP module created successfully with sources: ${HTTP_SOURCES}")
